package jphysics;

import javafx.event.EventHandler;
import javafx.scene.input.MouseEvent;
import javafx.scene.shape.Circle;

/**
 * @author KaLeonis
 */
public class DPoint extends Circle {

	public DPoint(double x, double y) {
		super(x, y, 10);
		
		this.setOnMouseDragged(new EventHandler<MouseEvent>() {
			public void handle(MouseEvent t) {
				onMouseDragged(t);
			}
		});
	}
	
	private void onMouseDragged(MouseEvent t) {
		setCenterX(t.getX());
		setCenterY(t.getY());
	}
}